# _*_ coding: utf-8 _*_
from odoo import models, fields, api


class ClassCodeMainTable(models.Model):
    _name = "class.code.child.table"
    _rec_name = "description"
    # name = fields.Char(compute="_compute_name")

    table_id = fields.Many2one("class.code.main.table", ondelete="cascade")

    module_code = fields.Char(string="Module Code", related="table_id.module_code",readonly=True)
    class_code = fields.Char(string="Class Code", related="table_id.class_code",readonly=True)
    value_code = fields.Char(string="Value Code")
    description = fields.Char(string="Value Description")

    # @api.depends("module_code", "class_code")
    # @api.multi
    # def _compute_name(self):
    #     for table in self:
    #         table.name = table.table_id.name + "-" + table.value_code
